#include  <math.h>
#include  <stdio.h>

double fun(double a,double x0)
{  
	double x1,y;
  	x1=(x0+a/x0)/2.0;
  	if(fabs(x1-x0)>=0.00001)
      	y=fun(a,x1);
  	else  	 	 
	  	y=x1;
  	return y;
}

int main()
{ 
	int n,i;
	double x,y;
	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		scanf("%lf",&x);
		if (x<0)
		{
			printf("error\n");
			break;
		}
		y=fun(x,1.0);
		printf("%.5lf\n",y);	
	}
}

